package com.zmzncs.lmtc.module.park.controller;


import com.zmzncs.lmtc.common.pojo.ChnnelsBody;
import com.zmzncs.lmtc.common.pojo.LoginUser;
import com.zmzncs.lmtc.common.pojo.Rest;
import com.zmzncs.lmtc.common.pojo.daoer.CreateMonth;
import com.zmzncs.lmtc.common.pojo.daoer.GateOnOff;
import com.zmzncs.lmtc.common.util.JwtUtil;
import com.zmzncs.lmtc.common.util.RestUtil;
import com.zmzncs.lmtc.module.order.pojo.order_Info.OrderInfoManageVO;
import com.zmzncs.lmtc.module.park.service.ParkInfoDaoerService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotNull;
import java.util.Map;

/**
 * <p>
 * 道尔车场拓展表 前端控制器
 * </p>
 *
 * @author 作者
 * @since 2021-02-05
 */
@RestController
@RequestMapping("/park/park-info-daoer")
public class ParkInfoDaoerController {

    @Autowired
    ParkInfoDaoerService parkInfoDaoerService;

//    @ApiOperation(value = "查询道尔停车场通道信息")
//    @ApiImplicitParams({
//            @ApiImplicitParam(paramType = "header", name = "token", value = "请求头token", required = true),
//            @ApiImplicitParam(paramType = "query",name = "parkId", value = "车场ID", required = true),
//    })
//    @PostMapping(value = "getDaoerChannels")
//    public Rest<ChnnelsBody> getDaoerChannels(@NotNull Long parkId) {
//        ChnnelsBody channels = parkInfoDaoerService.getDaoerChannels(parkId);
//        return RestUtil.success(channels);
//    }
//
//    @ApiOperation(value = "道尔停车场远程开闸")
//    @ApiImplicitParams({
//            @ApiImplicitParam(paramType = "header", name = "token", value = "请求头token", required = true),
//            @ApiImplicitParam(paramType = "query",name = "parkId", value = "车场ID", required = true),
//            @ApiImplicitParam(paramType = "query",name = "channelId", value = "roadWayCode 通道编号", required = true),
//            @ApiImplicitParam(paramType = "query",name = "channelIdStatus", value = "1开启 2 关闭", required = true),
//    })
//    @PostMapping(value = "daoerGateOnOff")
//    public Rest<GateOnOff> daoerGateOnOff(@NotNull Long parkId, @NotNull String channelId, @NotNull Integer channelIdStatus) {
//        GateOnOff channels = parkInfoDaoerService.daoerGateOnOff(parkId,channelId,channelIdStatus);
//        return RestUtil.success(channels);
//    }
//
//    @ApiOperation(value = "道尔月卡开户")
//    @ApiImplicitParams({
//            @ApiImplicitParam(paramType = "header", name = "token", value = "请求头token", required = true),
//    })
//    @PostMapping(value = "daoerCreatMonth")
//    public Rest<String> daoerCreatMonth(HttpServletRequest request, @RequestBody CreateMonth createMonth) {
//
//        String token = request.getHeader("token");
//        LoginUser loginUser = JwtUtil.getLoginUser(token);
//        createMonth.setParkManagerId(loginUser.getCustomerId());
//
//        Map<String, String> map = parkInfoDaoerService.daoerCreatMonth(createMonth);
//        String status = map.get("status");
//        String message = map.get("message");
//        if ("1".equals(status)){
//            return RestUtil.success(message);
//        } else {
//            return RestUtil.error(message);
//        }
//
//    }



}

